<?php
/* @var $this HzxxController */
/* @var $model Hzxx */

$this->breadcrumbs=array(
	'户主信息'=>array('index'),
	'管理',
);

$this->menu=array(
	array('label'=>'List Hzxx', 'url'=>array('index')),
	array('label'=>'Create Hzxx', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#hzxx-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<?php //echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:bolck">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php 
$ID  =Yii::app()->request->getParam('id');
if ($ID==1 ) {$linkcol =	array(
			'class'=>'CLinkColumn',
            'label'=>'添加',
            //'url'=>Yii::app()->createURL('hzxx/edit',array('userid'=>$data->userID)),
             'urlExpression'=>'Yii::app()->createUrl("famliyinfo/create",array("userid"=>$data->id))',//显示URL
            'linkHtmlOptions'=>array('class'=>'tablelink')
            
		);
        $viewlinkcol =	array(
			'class'=>'CLinkColumn',
            'label'=>'查看',
            //'url'=>Yii::app()->createURL('hzxx/edit',array('userid'=>$data->userID)),
             'urlExpression'=>'Yii::app()->createUrl("famliyinfo/admin",array("userid"=>$data->id))',//显示URL
            'linkHtmlOptions'=>array('class'=>'tablelink')
            
		);
        }
if ($ID==2 ){$linkcol =	    array(
			'class'=>'CLinkColumn',
            'label'=>'救助',
            //'url'=>Yii::app()->createURL('hzxx/edit',array('userid'=>$data->userID)),
             'urlExpression'=>'Yii::app()->createUrl("helpinfo/create",array("userid"=>$data->id))',//显示URL
            'linkHtmlOptions'=>array('class'=>'tablelink')
            
		);
         $viewlinkcol =	array(
			'class'=>'CLinkColumn',
            'label'=>'查看',
            //'url'=>Yii::app()->createURL('hzxx/edit',array('userid'=>$data->userID)),
             'urlExpression'=>'Yii::app()->createUrl("helpinfo/admin",array("userid"=>$data->id))',//显示URL
            'linkHtmlOptions'=>array('class'=>'tablelink',)
            
		);
        } 
$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'hzxx-grid',
	'dataProvider'=>$model->search(),
	//'filter'=>$model,
    'itemsCssClass' =>'tablelist',
	'columns'=>array(
		'usercode',
		'username',
		'userID',
		//'helpID',
		//'sex',
        'relation',
		'helptype',
		'usertype',
		'monthMoney',
		//'email',
		//'region1',
		//'region2',
		//'region3',
		'region4',
		'region5',
		//'hometown',
		'address',
		/*
		'age',
		
		'others',
		'tmpi1',
		'tmpi2',
		'tmpi3',
		'tmps1',
		'tmps2',
		'tmps3',
		*/
        $linkcol,
        $viewlinkcol
	),
)); ?>
